﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataAccess;
using BastInfos.Helpers;
using DataAccess.Helpers;
using BastInfos.Controllers;

namespace BastInfos.Models.Article
{
	public class ArticleModel
	{
		public int id_Article { get; set; }

		public string Title { get; set; }

		public string Content { get; set; }

		public bool ShowAlert { get; set; }

		public Comment Comment { get; set; }

		public IEnumerable<Comment> Comments { get; set; }

		public ArticleModel()
		{
			Comment = new Comment();
		}

		public ArticleModel(DataAccess.Article article)
		{
			Title		= article.Title;
			Content		= article.Content;
			Comments	= article.ValidComments;
			id_Article	= article.id_Article;
			Comment		= new Comment();
			ShowAlert = article != null && article.Status != (byte)StatusType.Visible/* && UserMembership.IsAuthenticated*/;
		}
	}
}